function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function isValidEmail(str) {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	return filter.test(str) ? true:false;
}
function checkForSubmit() {
	var notify = "";
	var warning = "";
	if (trim(document.myform.name.value) == "") {
		notify = notify + "- Name\n";
	}
	if (trim(document.myform.address.value) == "") {
		notify = notify + "- Address\n";
	}
	if (trim(document.myform.contact.value) == "") {
		notify = notify + "- Contact\n";
	}
	if (trim(document.myform.email.value) == "") {
		notify = notify + "- Email\n";
	}
	if (!isValidEmail(trim(document.myform.email.value))) {
		warning = "Email is invalid!";
	}
	if (notify != "") {
		notify = notify + "\nThe above field(s) can not be empty.";
		alert(notify);
	}
	else if (warning != "") {
		alert(warning);
	}
	else {
		document.myform.submit();
	}
}